package com.demo.provider.controller.apm;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("apm")
public class ApmDeomController {

    private static final Logger log = LoggerFactory.getLogger(ApmDeomController.class);

    Long second = (long)(Math.random() * 3000);
    @GetMapping("timelay")
    public String timelay() throws InterruptedException {

        Long second = (long)(Math.random() * 3000);
        Thread.sleep(second);
        log.info("/apm/timelay  timelay is {}", second);
        System.out.println("demo-provider/apm timelay is "+ second);
        return "timelay "+second+" ms";
    }
}
